package STUDENT.TRANDAODAIVI.ARRAY;
class Array500{
	public static int getMinimum(int[] array){
		int k=0;
		for (int i=0;i<array.length;i++){
		if (i==0){
			k=i;
		} else if (array[i]<k){
			k=array[i];
		}
		}
		return k;
}	
		
	
	public static int getMaximum(int[] array){
		int k=0;
		for (int i=0;i<array.length;i++){
		if (i==0){
			k=i;
		} else if (array[i]>k){
			k=array[i];
		}
		}
		return k;
	}
	public static void showMinimum(int[] array){
		System.out.println("Minimum: "+Array500.getMinimum(array));
		for (int i=0;i<array.length;i++){
			if(array[i]==Array500.getMinimum(array)){
				System.out.println("Phan tu "+(i+1)+" : "+array[i]);
		} 
	}
}
	public static void showMaximum(int[] array){
		System.out.println("Maximum: "+Array500.getMaximum(array));
		for (int i=0;i<array.length;i++){
			if(array[i]==Array500.getMaximum(array)){
				System.out.println("Phan tu "+(i+1)+" : "+array[i]);
		}
	}
}
	
}

public class BT4 {
public static void main(String[] args) {
	int[] Array1={1,2,4,5,10,100,2,-22,100,99,80,5};
	
	Array500.showMaximum(Array1);
	Array500.showMinimum(Array1);
	
}
}
